﻿using ControleRepresentante.Data.Catalogs;
using ControleRepresentante.Data.Helpers;

namespace ControleRepresentante.Data.CatalogSteps
{
    internal class CreateRelatorioVisitaCatalogStep : CatalogStepBase<ControleRepresentanteCatalogStepTypes>
    {
        protected override ControleRepresentanteCatalogStepTypes CatalogStepType
        {
            get { return ControleRepresentanteCatalogStepTypes.CreateRelatorioVisita; }
        }

        public override void Execute(IDataAccess dataAccess)
        {
            new CatalogStepHelper(dataAccess).CreateTable("RelatorioVisita", false, "AttributeHolderId")
                .AddForeignKey("AttributeHolderId", "AttributeHolder")
                .AddColumn("ClienteId", ColumnType.Guid, false, false)
                .AddForeignKey("ClienteId", "Cliente", "UsuariosHolderId")
                .AddColumn("VendedorId", ColumnType.Guid, false, false)
                .AddForeignKey("VendedorId", "Vendedor", "UsuariosHolderId")
                .AddColumn("Data", ColumnType.DateTime, false, false)
                .AddColumn("Observacao", ColumnType.LongText, false, false);
        }
    }
}
